####################################
# Germany 20000 - 20999 by Lothos
####################################
# Who he is invading flags
#	GERInvadePoland 		= Preparing to invade Poland
#	GERInvadeNorway 		= Preparing to invade Norway
#	GERLowCountriesPrepare	= Prepare to invade Belgium, Holland and Luxemburg
#	GERInvadeRussia			= Prepare to invade Russia
#	GERInvadeSpain			= Prepare to invade Spain
#	GERInvadeEngland		= Prepare to invade England
#	GERInvadeYugoslavia		= Prepare to invade Yugoslavia
#	InvYugoslavia			= Global flag to tell minors to prepare

# Building Style Flags
#	GERBuildStandard		= Standard Build when strategy is unknown
#	GERBuildNavy			= Build Navy when preparing to attack the UK and USA
#	GERBuildLand			= Build heavy on the land troops with no sea
#	GERBuildMix				= Build mix of land and subs

# Behavior Flags
#	GERStandardFront		= Load standard front AI to save supplies etc....
#	GERSubPatrol			= Sub Patrol AI loaded
#	GERSubPatrol1			= East Atlantic Sub Patern
#	GERSubPatrol2			= Central Atlantic and East Coast Patern
#	GERSubPatrol3			= Carabean and Central Atlantic Patern

# Air AI Flags
#	GERAirAINaval			= Germany has there Air vs Naval AI loaded
#	GERAirAIStrategic		= Germany has their Strategic bombing AI loaded
#	GERAirAIGround			= Germany has their ground support AI loaded

# Garrisoning Flags
#	GERBalticGarrison		= Garrison the Baltic normally
#	GERBalticGarrisonRussia	= Garrison the Baltic based on war with Russia

################
# Norway Invasion AI
#############################################
event = {
	id = 20000
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = GERInvadeNorway }
		NOT = {	lost_national = { country = GER value = 2 } }
		OR = {
			war = { country = NOR country = GER }
			war = { country = SWE country = GER }
			war = { country = FIN country = GER }
		}
		NOT = {
			AND = { # LOW COUNTRIES
				war = { country = GER country = HOL }
				NOT = { control = { province = 47 data = GER } } # Amsterdamm
			}
			AND = {
				war = { country = GER country = BEL }
				NOT = { control = { province = 51 data = GER } } # Brussels
			}
			AND = {
				war = { country = GER country = FRA }
				NOT = { control = { province = 56 data = GER } } # Paris
				OR = {
					war = { country = GER country = HOL }
					war = { country = GER country = BEL }
				}
			}
			AND = {
				war = { country = GER country = SOV }
				NOT = { land_percentage = { country = SOV value = 0.8 } }
				NOT = { lost_national = { country = SOV value = 10 } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeNorway }
		command = { type = local_clrflag which = GERSubPatrol }
		command = { type = ai which = "switch/GER_Norway.ai" }
	}
}
################
# End of Norway Invasion AI
#############################################
event = {
	id = 20001
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = GERInvadeNorway
		OR = {
			lost_national = { country = GER value = 2 }
			NOT = {
				war = { country = NOR country = GER }
				war = { country = SWE country = GER }
				war = { country = FIN country = GER }
			}
			AND = { # LOW COUNTRIES
				war = { country = GER country = HOL }
				NOT = { control = { province = 47 data = GER } } # Amsterdamm
			}
			AND = {
				war = { country = GER country = BEL }
				NOT = { control = { province = 51 data = GER } } # Brussels
			}
			AND = {
				war = { country = GER country = FRA }
				NOT = { control = { province = 56 data = GER } } # Paris
				OR = {
					war = { country = GER country = HOL }
					war = { country = GER country = BEL }
				}
			}
			AND = {
				war = { country = GER country = SOV }
				NOT = { land_percentage = { country = SOV value = 0.8 } }
				NOT = { lost_national = { country = SOV value = 10 } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERInvadeNorway }
		command = { type = ai which = "switch/GER_Norway_END.ai" }
	}
}
################
# Poland Invasion AI
#############################################
event = {
	id = 20002
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		NOT = { ispuppet = GER }
		OR = {
			AND = {
				local_flag = GERInvadePoland
				month = 4 # May
				NOT = { month = 9 } # October
				AND = {
					day = 1
					NOT = { day = 2 }
				}
			}
			event = 2027 #Danzig or War
			event = 20012 # German standard War AI
			AND = {	
				war = { country = POL country = GER }
				event = 2027 #Danzig or War
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = september year = 1939 }
	offset = 1
	deathdate = { day = 2 month = september year = 1939 }

	action_a = {
		command = { type = ai which = "switch/GER_Poland.ai" }
		command = { type = war which = POL }
		command = { type = local_clrflag which = GERInvadePoland }
		command = { type = local_clrflag which = GERStandardFront }
		command = { type = sleepevent which = 20023 } # Prepare for invasion of Poland event
	}
}
################
# Germany mass on low countries border
#############################################
event = {
	id = 20003
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			AND = {
				day = 2
				NOT = { day = 3 }
			}
		}
		NOT = { local_flag = GERLowCountriesPrepare }
		war = { country = FRA country = GER }
		NOT = { war = { country = POL country = GER } }
		NOT = { war = { country = SOV country = GER } }
		NOT = { war = { country = BEL country = GER } }
		NOT = { war = { country = AUS country = GER } }
		NOT = { war = { country = CZE country = GER } }
		NOT = { war = { country = HUN country = GER } }
		AND = {
			exists = SCH
			NOT = { war = { country = SCH country = GER } }
		}
		AND = {
			OR = {
				NOT = { exists = AUS }
				NOT = { war = { country = AUS country = GER } }
			}
			OR = {
				NOT = { exists = CZE }
				NOT = { war = { country = CZE country = GER } }
			}
			NOT = { war = { country = YUG country = GER } }
		}
		AND = {
			OR = {
				NOT = { exists = AUS }
				NOT = { war = { country = AUS country = GER } }
			}
			NOT = { war = { country = ITA country = GER } }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 30 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Poland_After.ai" }
		command = { type = local_setflag which = GERLowCountriesPrepare }
		command = { type = local_clrflag which = GERBalticGarrison }
		command = { type = local_clrflag which = GERBalticGarrisonRussia }
	}
}
################
# German Invasion AI Low Countries German Invasion if early war
########################################
event = {
	id = 20004
	random = no
	country = GER

	trigger = {
		ai = yes
		OR = {
			alliance = { country = SPA country = GER }
			alliance = { country = SPR country = GER }
			AND = {
				month = 4 # May
				NOT = { month = 7 } # August
			}
		}
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		local_flag = GERLowCountriesPrepare
		government = fascist
		OR = {
			AND = {
				war = { country = FRA country = GER }
				NOT = {	war = { country = SOV country = GER } }
				NOT = {	war = { country = POL country = GER } }
				NOT = { event = 20002 }
			}
			AND = {
				event = 20002
				war = { country = FRA country = GER }
				NOT = {	war = { country = SOV country = GER } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 30 month = december year = 1948 }

	action_a = {
		command = { type = sleepevent which = 20003 }
		command = { type = war which = BEL }
		command = { type = war which = HOL }
		command = { type = war which = LUX }
		command = { type = ai which = "switch/GER_France.ai" }
		command = { type = local_clrflag which = GERLowCountriesPrepare }
		command = { type = local_clrflag which = GERStandardFront }
	}
}
################
# Load Germany Standard Front AI
#############################################
event = {
	id = 20005
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = GERStandardFront }
		OR = {
			AND = {
				local_flag = GERInvadePoland
				NOT = { war = { country = GER country = POL } }
			}
			AND = {
				local_flag = GERInvadeYugoslavia
				NOT = { war = { country = GER country = YUG } }
			}
			AND = {
				local_flag = GERInvadeRussia
				NOT = { war = { country = GER country = YUG } }
			}
			AND = {
				OR = {
					local_flag = GERInvadeSpain
					local_flag = GERInvadeEngland
				}
				NOT = { war = { country = GER country = SPR } }
				NOT = { war = { country = GER country = SPA } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 3
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Standard_Front.ai" }
		command = { type = local_setflag which = GERStandardFront }
	}
}
################
# Baklan Campaign
#############################################
event = {
	id = 20006
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		exists = YUG
		NOT = { ispuppet = GER }
		day = 2
		NOT = { day = 3 }
		NOT = { war= { country = YUG country = GER } }
		NOT = { alliance= { country = YUG country = GER } }
		NOT = { alliance= { country = YUG country = SOV } }
		NOT = { puppet = { country = YUG country = GER } }
		NOT = { local_flag = GERInvadePoland }
		NOT = { local_flag = GERInvadeEngland }
		NOT = { local_flag = GERInvadeSpain }
		#Austria Provinces if not he must invade Austria
		control = { province = 377 data = GER }
		control = { province = 461 data = GER }
		control = { province = 460 data = GER }
		OR = {
			local_flag = GERInvadeRussia
			AND = {
				alliance = { country = GER country = ITA }
				NOT = {	lost_national = { country = GER value = 2 } }
				control = { province = 56 data = GER } # Paris
				NOT = { war= { country = GER country = SOV } }
				NOT = { war= { country = GER country = SPA } }
				NOT = { war= { country = GER country = SPR } }
				OR = {
					war= { country = ITA country = GRE }
					war= { country = ITA country = YUG }
					war= { country = ITA country = ALB }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Baklans.ai" }
		command = { type = local_setflag which = GERInvadeYugoslavia }
		command = { type = setflag which = InvYugoslavia }
		command = { type = local_clrflag which = GERInvadeRussia }
	}
}
################
# Germany invades Russian
#############################################
event = {
	id = 20007
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		NOT = { ispuppet = GER }
		OR = {
			month = 6
			AND = {
				day = 21
				NOT = { day = 22 }
			}
		}
		AND = {
			OR = {
				AND = {
					owned = { province = 488 data = GER }
					control = { province = 488 data = GER } 
					garrison = { country = GER province = 488  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 488 data = GER } }
					NOT = { control = { province = 488 data = GER } }
				}
			}
			OR = {
				AND = {
					owned = { province = 489 data = GER }
					control = { province = 489 data = GER } 
					garrison = { country = GER province = 489  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 489 data = GER } }
					NOT = { control = { province = 489 data = GER } }
				}
			}
			OR = {
				AND = {
					owned = { province = 487 data = GER }
					control = { province = 487 data = GER } 
					garrison = { country = GER province = 487  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 487 data = GER } }
					NOT = { control = { province = 487 data = GER } }
				}
			}
			OR = {
				AND = {
					owned = { province = 509 data = GER }
					control = { province = 509 data = GER } 
					garrison = { country = GER province = 509  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 509 data = GER } }
					NOT = { control = { province = 509 data = GER } }
				}
			}
			OR = {
				AND = {
					owned = { province = 510 data = GER }
					control = { province = 510 data = GER } 
					garrison = { country = GER province = 510  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 510 data = GER } }
					NOT = { control = { province = 510 data = GER } }
				}
			}
			OR = {
				AND = {
					owned = { province = 206 data = GER }
					control = { province = 206 data = GER } 
					garrison = { country = GER province = 206  type = land size = 9 area = no }
				}
				AND = {
					NOT = { owned = { province = 206 data = GER } }
					NOT = { control = { province = 206 data = GER } }
				}
			}
		}
		local_flag = GERInvadeRussia
		NOT = { local_flag = GERInvadePoland }
		NOT = { local_flag = GERInvadeYugoslavia }
		NOT = {	lost_national = { country = GER value = 2 } }
		control = { province = 56 data = GER } # Paris
		NOT = { war = { country = GER country = SOV } }
		NOT = { war = { country = GER country = SPA } }
		NOT = { war = { country = GER country = SPR } }
		NOT = { war = { country = GER country = YUG } }
		OR = {
			land_percentage = { country = SOV value = 0.8 }
			AND = {
				land_percentage = { country = SOV value = 0.7 }
				alliance = { country = GER country = ROM }
				alliance = { country = GER country = HUN }
			}
		}
		OR = {
			NOT = { war= { country = GER country = GRE } }
			AND = {
				war= { country = GER country = GRE }			
				NOT = { control = { province = 401 data = GRE } } # Athens
				NOT = { control = { province = 393 data = GRE } }
				NOT = { control = { province = 395 data = GRE } }
				NOT = { control = { province = 394 data = GRE } }
				NOT = { control = { province = 402 data = GRE } }
				NOT = { control = { province = 403 data = GRE } }
				NOT = { control = { province = 392 data = GRE } }
				NOT = { control = { province = 412 data = GRE } }
				NOT = { control = { province = 411 data = GRE } }
				NOT = { control = { province = 410 data = GRE } }
			}
		}
		OR = {
			alliance = { country = GER country = POL }
			alliance = { country = SOV country = POL }
			NOT = { exists = POL }
		}
		OR = {
			AND = {
				month = 3 # April
				NOT = {	month = 4 } # May
				random = 10
			}
			AND = {
				month = 4 # May
				NOT = {	month = 5 } # June
				random = 20
			}
			AND = {
				month = 5 # June
				NOT = {	month = 6 } # July
				random = 90
			}
			AND = {
				month = 6 # July
				NOT = {	month = 7 } # August
				random = 80
			}
			AND = {
				month = 7 # August
				NOT = {	month = 8 } # September
				random = 20
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1941 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = { #Russian Campaign
		command = { type = war which = SOV }
		command = { type = sleepevent which = 20013 }
		command = { type = sleepevent which = 20010 }
		command = { type = ai which = "switch/GER_Russia.ai" }
		command = { type = local_clrflag which = GERInvadeRussia }
		command = { type = local_clrflag which = GERStandardFront }
	}
}
################
# Germany builds paratroopers and transport plane 
#############################################
event = {
	id = 20008
	random = no
	country = GER
	persistent = yes
	style = 0	

	trigger = {
		ai = yes
		technology = 4250
		NOT = { lost_national = { country = GER value = 2 } }
		NOT = { transport_plane = { country = GER value = 2 } }
	}

	date = { day = 1 month = october year = 1938 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	name = "AI_EVENT"

	action_a = {
		command = { type = build_division which = transport_plane }
	}
}
event = {
	id = 20009
	random = no
	country = GER
	persistent = yes
	style = 0	

	trigger = {
		ai = yes
		technology = 1070 # Airborne
		NOT = { lost_national = { country = GER value = 2 } }
		OR = {
			AND = {
				transport_plane = { country = GER value = 1 }
				NOT = { transport_plane = { country = GER value = 1 } }
				NOT = { paratrooper = { country = GER value = 1 } }
			}
			AND = {
				transport_plane = { country = GER value = 2 }
				NOT = { paratrooper = { country = GER value = 2 } }
			}
		}
	}

	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	name = "AI_EVENT"

	action_a = {
		command = { type = build_division which = paratrooper }
	}
}
################
# German vs. Russian war setup
#############################################
event = {
	id = 20010
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		war= { country = GER country = SOV }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = { #Russian Campaign
		command = { type = ai which = "switch/GER_Russia.ai" }
		command = { type = sleepevent which = 20007 }
	}
}
################
# Baklan Campaign Part 2
#############################################
event = {
	id = 20011
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		local_flag = GERInvadeYugoslavia
		OR = {
			NOT = { exists = YUG }
			war = { country = GER country = YUG }
			AND = {
				atwar = YUG
				NOT = { alliance = { country = YUG country = SOV } }
			}
			AND = {
				exists = YUG
				month = 2 # March
				NOT = { month = 5 } # June
				local_flag = GERInvadeYugoslavia
				control = { province = 56 data = GER } # Paris
				NOT = { war = { country = GER country = SOV } }
				NOT = { war = { country = GER country = CZE } }
				NOT = { war = { country = GER country = POL } }
				AND = {
					day = 1
					NOT = { day = 2 }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Yugoslavia.ai" }
		command = { type = war which = YUG }
		command = { type = clrflag which = InvYugoslavia }
		command = { type = local_clrflag which = GERInvadeYugoslavia }
		command = { type = local_clrflag which = GERStandardFront }
		command = { type = sleepevent which = 20006 }
	}
}
################
# German changes production values atwar
#############################################
event = {
	id = 20012
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		atwar = GER
		NOT = { war = { country = SOV country = GER } }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_atwar.ai" }
	}
}
################
# Germany masses on Russian border setup
#############################################
event = {
	id = 20013
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { ispuppet = GER }
		day = 22
		NOT = { day = 23 }
		event = 20014 # Decide Strategy
		NOT = { local_flag = GERInvadeRussia }
		NOT = { local_flag = GERInvadeYugoslavia }
		NOT = { local_flag = GERInvadePoland }
		NOT = { local_flag = GERInvadeSpain }
		NOT = { local_flag = GERInvadeEngland }
		NOT = { war= { country = GER country = SOV } }
		NOT = { war= { country = GER country = SPA } }
		NOT = { war= { country = GER country = SPR } }
		NOT = { war= { country = GER country = YUG } }
		NOT = { war= { country = GER country = POL } }
		NOT = { war= { country = GER country = AUS } }
		NOT = { war= { country = GER country = CZE } }
		NOT = { war= { country = GER country = HUN } }
		NOT = { war= { country = GER country = ROM } }
		NOT = { war= { country = GER country = BUL } }
		control = { province = 56 data = GER } # Paris
		OR = {
			NOT = { war= { country = GER country = GRE } }
			AND = {
				war= { country = GER country = GRE }		
				NOT = { control = { province = 401 data = GRE } } # Athens
				#NOT = { control = { province = 393 data = GRE } }
				#NOT = { control = { province = 395 data = GRE } }
				#NOT = { control = { province = 394 data = GRE } }
				NOT = { control = { province = 402 data = GRE } }
				NOT = { control = { province = 403 data = GRE } }
				NOT = { control = { province = 392 data = GRE } }
				NOT = { control = { province = 412 data = GRE } }
				NOT = { control = { province = 411 data = GRE } }
				NOT = { control = { province = 410 data = GRE } }
			}
		}
		OR = {
			flag = GC1939 # 1939 Grand Campaign
			event = 2013  # Molotov Pact Historical
			event = 2015  # Molotov Pact Alliance
			event = 2016  # Molotov Pact Limited
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Russia_Buildup.ai" }
		command = { type = local_setflag which = GERInvadeRussia }
	}
}
################
# German decides strategy after Paris falls
#############################################
event = {
	id = 20014
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		NOT = { ispuppet = GER }
		NOT = {	lost_national = { country = GER value = 2 } }
		control = { province = 56 data = GER } # Paris
		NOT = { war= { country = GER country = SOV } }
		NOT = { war= { country = GER country = SPA } }
		NOT = { war= { country = GER country = SPR } }
		NOT = { war= { country = GER country = YUG } }
		NOT = { war= { country = GER country = POL } }
		OR = {
			lost_national = { country = FRA value = 90 }
			exists = VIC
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = { #Russian Campaign
		ai_chance = 80
		command = { type = local_setflag which = GERInvadeRussia }
	}
	action_b = { #Launch Sea Lion
		ai_chance = 20
		command = { type = local_setflag which = GERInvadeSpain }
	}
}
################
# Early USA War entry before war with Russia (Cancels Russian Invasion Plan)
#############################################
#event = {
#	id = 20015
#	random = no 
#	country = GER
	
#	trigger = {
#		ai = yes
#		NOT = { event = 20007 }
#		NOT = {	lost_national = { country = GER value = 2 } }
#		control = { province = 56 data = GER } # Paris
#		war= { country = GER country = USA }
#		war= { country = GER country = ENG }
#		NOT = { war= { country = GER country = SOV } }
#	}

#	name = "AI_EVENT"
#	style = 0	
	
#	date = { day = 1 month = january year = 1936 }
#	offset = 4
#	deathdate = { day = 29 month = december year = 1948 }

#	action_a = { # Load Sea Lion and Hold of Russia
#		command = { type = local_setflag which = GERInvadeSpain }
#		command = { type = sleepevent which = 20007 }
#		command = { type = sleepevent which = 20013 }
#	}
#}
################
# German Change Front to defensive when war with USA and SOV
#############################################
event = {
	id = 20016
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		random = 30
		war= { country = GER country = USA }
		war= { country = GER country = SOV }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 12
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_War_SOV_USA.ai" }
	}
}
################
# Germany will no longer garrison beaches in the Baltic when Denmark is taken out
#############################################
event = {
	id = 20017
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		control = { province = 90 data = GER } # Kiel
		NOT = { local_flag = GERBalticGarrison }
		NOT = { local_flag = GERBalticGarrisonRussia }
		OR = {
			alliance = { country = DEN country = GER }
			control = { province = 294 data = GER } # Copenhagen
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 12
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERBalticGarrison }
		command = { type = local_clrflag which = GERBalticGarrisonRussia }
		command = { type = ai which = "switch/GER_Baltic.ai" }
	}
}
################
# Germany re-garrisons the Baltic
#############################################
event = {
	id = 20018
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = GERBalticGarrison
		OR = {
			NOT = { control = { province = 90 data = GER } } # Kiel
			AND = {
				alliance = { country = DEN country = GER }
				NOT = { control = { province = 294 data = DEN } } # Copenhagen
			}
			AND = {
				NOT = { exists = DEN }
				NOT = { control = { province = 294 data = GER } } # Copenhagen
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 12
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Baltic2.ai" }
		command = { type = local_clrflag which = GERBalticGarrison }
	}
}
################
# Germany will no longer garrison beaches in the Baltic when Denmark is taken out and atwar with Russia
#############################################
event = {
	id = 20019
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = GERBalticGarrison }
		war = { country = SOV country = GER }
		control = { province = 90 data = GER } # Kiel
		OR = {
			alliance = { country = DEN country = GER }
			control = { province = 294 data = GER } # Copenhagen
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 12
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Baltic_Russia.ai" }
		command = { type = local_setflag which = GERBalticGarrison }		
		command = { type = local_setflag which = GERBalticGarrisonRussia }
	}
}
################
# Germany goes after England when Russian is gone
#############################################
event = {
	id = 20020
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		event = 20010
		NOT = { war = { country = GER country = SOV } }
		control = { province = 56 data = GER } # Paris
		war = { country = GER country = ENG }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeSpain }
	}
}
################
# Germany goes on the defensive in first Winter against Russia
#############################################
event = {
	id = 20021
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		event = 20007
		NOT = {	lost_national = { country = GER value = 2 } }
		war = { country = GER country = SOV }
		control = { province = 56 data = GER } # Paris
		OR = {
			month = 10 # November
			AND = {
				month = 0 # January
				NOT = { month = 2 } # March
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Winter.ai" }
	}
}
################
# Germany goes back on the offensive second year
#############################################
event = {
	id = 20022
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		event = 20021
		war = { country = GER country = SOV }
		NOT = { war = { country = GER country = USA } }
		month = 3 # April
		NOT = { month = 7 } # August
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = ai which = "switch/GER_Russia_Second_Year.ai" }
	}
}
################
# Germany prepares for war with Poland
#############################################
event = {
	id = 20023
	random = no 
	country = GER
	persistent = yes

	trigger = {
		ai = yes
		atwar = no
		exists = POL
		NOT = { local_flag = GERInvadePoland }
		NOT = { alliance = { country = POL country = GER } }
		NOT = { alliance = { country = POL country = SOV } }
		NOT = { puppet = { country = POL country = GER } }
		NOT = { war = { country = POL country = GER } }
		NOT = { war = { country = AUS country = GER } }
		NOT = { war = { country = CZE country = GER } }
		NOT = { war = { country = SOV country = GER } }		
		OR = {
			AND = {
				local_flag = GERInvadeRussia
				OR = {
					AND = {
						day = 2
						NOT = { day = 3 }
					}
				}
			}
			event = 2040 # Annexation of CZE
			event = 2005 # CZE Refuses claim
			event = 2004 # CZE joins Axis
			AND = {
				event = 2030 # Treaty of Munich
				NOT = { event = 2200  } # CZE response to Treaty of Munich
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadePoland }
		command = { type = ai which = "switch/GER_Fall_CZE.ai" }
	}
}
################
# Germany declares war on Denmark cause allies are in the Baltic
#############################################
event = {
	id = 20024
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		NOT = { ispuppet = GER }
		random = 25
		exists = DEN
		NOT = { war = { country = DEN country = GER } }
		OR = {
			AND = {
				war = { country = FRA country = GER }
				OR = {
					# Baltic
					garrison = { country = FRA province = 2476  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2477  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2478  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2479  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2480  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2481  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2482  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2483  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2484  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2489  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2491  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2492  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2493  type = naval size = 4 area = no }
					garrison = { country = FRA province = 2494  type = naval size = 4 area = no }
				}
			}
			AND = {
				war = { country = ENG country = GER }
				OR = {
					# Baltic
					garrison = { country = ENG province = 2476  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2477  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2478  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2479  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2480  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2481  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2482  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2483  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2484  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2489  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2491  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2492  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2493  type = naval size = 4 area = no }
					garrison = { country = ENG province = 2494  type = naval size = 4 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 4
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = war which = DEN }
	}
}

################
# German Sub Patrols AI
#############################################
event = {
	id = 20025
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		day = 1
		NOT = { day = 2 }
		NOT = { local_flag = GERInvadeNorway }
		OR = {
			NOT = { local_flag = GERInvadeEngland }
			AND = {
					local_flag = GERInvadeEngland
					OR = {
						war= { country = GER country = SOV }
						war= { country = GER country = USA }
					}
			}
		}
		OR = {
			NOT = { local_flag = GERSubPatrol }
			AND = {
				month = 0
				NOT = { month = 1 }
			}
			AND = {
				month = 2
				NOT = { month = 3 }
			}
			AND = {
				month = 4
				NOT = { month = 5 }
			}
			AND = {
				month = 6
				NOT = { month = 7 }
			}
			AND = {
				month = 8
				NOT = { month = 9 }
			}
			AND = {
				month = 10
				NOT = { month = 11 }
			}
		}
		OR = {
			war = { country = ENG country = GER }
			war = { country = FRA country = GER }
			war = { country = USA country = GER }
		}
		OR = {
			event = 20004
			control = { province = 56 data = GER } # Paris
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {  # Sub Patrol North Atlantic
		ai_chance = 35
		command = { type = ai which = "switch/GER_Sub_Patrol1.ai" }
		command = { type = local_setflag which = GERSubPatrol }
		command = { type = local_setflag which = GERSubPatrol1 }
		command = { type = local_clrflag which = GERSubPatrol2 }
		command = { type = local_clrflag which = GERSubPatrol3 }
	}
	action_b = {  # Sub Patrol Central Atlantic
		ai_chance = 35
		command = { type = ai which = "switch/GER_Sub_Patrol2.ai" }
		command = { type = local_setflag which = GERSubPatrol }
		command = { type = local_setflag which = GERSubPatrol2 }
		command = { type = local_clrflag which = GERSubPatrol1 }
		command = { type = local_clrflag which = GERSubPatrol3 }
	}
	action_c = {  # Sub Patrol South Atlantic
		ai_chance = 30
		command = { type = ai which = "switch/GER_Sub_Patrol3.ai" }
		command = { type = local_setflag which = GERSubPatrol }
		command = { type = local_setflag which = GERSubPatrol3 }
		command = { type = local_clrflag which = GERSubPatrol2 }
		command = { type = local_clrflag which = GERSubPatrol1 }
		
	}
}
################
# German Air AI Naval portion
#############################################
event = {
	id = 20026
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = GERAirAINaval }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be false if not the land air AI has priority
		NOT = {
			lost_national = { country = GER value = 2 }
			war = { country = GER country = POL } # Eastern Europe
			war = { country = GER country = CZE }
			war = { country = GER country = HUN }
			war = { country = GER country = ROM }
			war = { country = GER country = YUG }
			war = { country = GER country = GRE }
			war = { country = GER country = LIT }
			war = { country = GER country = LAT }
			war = { country = GER country = EST }
			war = { country = GER country = BUL }
			war = { country = GER country = SOV }
			war = { country = GER country = AUS } # Central Europe
			war = { country = GER country = ITA }
			AND = { 								# LOW COUNTRIES
				war = { country = GER country = HOL }
				NOT = { control = { province = 47 data = GER } } # Amsterdamm
			}
			AND = {
				war = { country = GER country = BEL }
				NOT = { control = { province = 51 data = GER } } # Brussels
			}
			war = { country = GER country = LUX }
			war = { country = GER country = SPR } # Western Europe
			war = { country = GER country = SPA }
			war = { country = GER country = POR }
			war = { country = GER country = VIC }
			AND = {
				war = { country = GER country = FRA }
				NOT = { control = { province = 56 data = GER } } # Paris
				OR = {
					war = { country = GER country = HOL }
					war = { country = GER country = BEL }
				}
			}
		}
		# These statements have to be true for it to load naval AI
		OR = {
			local_flag = GERInvadeEngland
			AND = {
				war = { country = FRA country = GER }
				OR = {
					# Baltic
					garrison = { country = FRA province = 2473  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2474  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2475  type = naval size = 2 area = no }
					garrison = { country = FRA province = 290   type = naval size = 2 area = no }
					garrison = { country = FRA province = 2476  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2477  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2478  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2479  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2480  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2481  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2482  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2483  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2484  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2489  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2491  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2492  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2493  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = ENG country = GER }
				OR = {
					# Baltic
					garrison = { country = ENG province = 2473  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2474  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2475  type = naval size = 2 area = no }
					garrison = { country = ENG province = 290   type = naval size = 2 area = no }
					garrison = { country = ENG province = 2476  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2477  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2478  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2479  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2480  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2481  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2482  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2483  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2484  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2489  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2491  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2492  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2493  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = USA country = GER }
				OR = {
					# Baltic
					garrison = { country = USA province = 2473  type = naval size = 2 area = no }
					garrison = { country = USA province = 2474  type = naval size = 2 area = no }
					garrison = { country = USA province = 2475  type = naval size = 2 area = no }
					garrison = { country = USA province = 290   type = naval size = 2 area = no }
					garrison = { country = USA province = 2476  type = naval size = 2 area = no }
					garrison = { country = USA province = 2477  type = naval size = 2 area = no }
					garrison = { country = USA province = 2478  type = naval size = 2 area = no }
					garrison = { country = USA province = 2479  type = naval size = 2 area = no }
					garrison = { country = USA province = 2480  type = naval size = 2 area = no }
					garrison = { country = USA province = 2481  type = naval size = 2 area = no }
					garrison = { country = USA province = 2482  type = naval size = 2 area = no }
					garrison = { country = USA province = 2483  type = naval size = 2 area = no }
					garrison = { country = USA province = 2484  type = naval size = 2 area = no }
					garrison = { country = USA province = 2489  type = naval size = 2 area = no }
					garrison = { country = USA province = 2491  type = naval size = 2 area = no }
					garrison = { country = USA province = 2492  type = naval size = 2 area = no }
					garrison = { country = USA province = 2493  type = naval size = 2 area = no }
					garrison = { country = USA province = 2494  type = naval size = 2 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERAirAINaval }
		command = { type = local_clrflag which = GERAirAIStrategic }
		command = { type = local_clrflag which = GERAirAIGround }
		command = { type = ai which = "switch/GER_Air_Naval.ai" }
	}
}
################
# German Air AI Ground portion
#############################################
event = {
	id = 20027
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = GERAirAIGround }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be false if not the land air AI has priority
		OR = {
			lost_national = { country = GER value = 2 }
			war = { country = GER country = POL } # Eastern Europe
			war = { country = GER country = CZE }
			war = { country = GER country = HUN }
			war = { country = GER country = ROM }
			war = { country = GER country = YUG }
			war = { country = GER country = GRE }
			war = { country = GER country = LIT }
			war = { country = GER country = LAT }
			war = { country = GER country = EST }
			war = { country = GER country = BUL }
			war = { country = GER country = SOV }
			war = { country = GER country = AUS } # Central Europe
			war = { country = GER country = ITA }
			AND = { 								# LOW COUNTRIES
				war = { country = GER country = HOL }
				NOT = { control = { province = 47 data = GER } } # Amsterdamm
			}
			AND = {
				war = { country = GER country = BEL }
				NOT = { control = { province = 51 data = GER } } # Brussels
			}
			war = { country = GER country = LUX }
			war = { country = GER country = SPR } # Western Europe
			war = { country = GER country = SPA }
			war = { country = GER country = POR }
			war = { country = GER country = VIC }
			AND = {
				war = { country = GER country = FRA }
				NOT = { control = { province = 56 data = GER } } # Paris
				OR = {
					war = { country = GER country = HOL }
					war = { country = GER country = BEL }
				}
			}
		}
		# These statements have to be true for it to load naval AI
		NOT = {
			AND = {
				war = { country = FRA country = GER }
				OR = {
					# Baltic
					garrison = { country = FRA province = 2473  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2474  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2475  type = naval size = 2 area = no }
					garrison = { country = FRA province = 290   type = naval size = 2 area = no }
					garrison = { country = FRA province = 2476  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2477  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2478  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2479  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2480  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2481  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2482  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2483  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2484  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2489  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2491  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2492  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2493  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = ENG country = GER }
				OR = {
					# Baltic
					garrison = { country = ENG province = 2473  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2474  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2475  type = naval size = 2 area = no }
					garrison = { country = ENG province = 290   type = naval size = 2 area = no }
					garrison = { country = ENG province = 2476  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2477  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2478  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2479  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2480  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2481  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2482  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2483  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2484  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2489  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2491  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2492  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2493  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = USA country = GER }
				OR = {
					# Baltic
					garrison = { country = USA province = 2473  type = naval size = 2 area = no }
					garrison = { country = USA province = 2474  type = naval size = 2 area = no }
					garrison = { country = USA province = 2475  type = naval size = 2 area = no }
					garrison = { country = USA province = 290   type = naval size = 2 area = no }
					garrison = { country = USA province = 2476  type = naval size = 2 area = no }
					garrison = { country = USA province = 2477  type = naval size = 2 area = no }
					garrison = { country = USA province = 2478  type = naval size = 2 area = no }
					garrison = { country = USA province = 2479  type = naval size = 2 area = no }
					garrison = { country = USA province = 2480  type = naval size = 2 area = no }
					garrison = { country = USA province = 2481  type = naval size = 2 area = no }
					garrison = { country = USA province = 2482  type = naval size = 2 area = no }
					garrison = { country = USA province = 2483  type = naval size = 2 area = no }
					garrison = { country = USA province = 2484  type = naval size = 2 area = no }
					garrison = { country = USA province = 2489  type = naval size = 2 area = no }
					garrison = { country = USA province = 2491  type = naval size = 2 area = no }
					garrison = { country = USA province = 2492  type = naval size = 2 area = no }
					garrison = { country = USA province = 2493  type = naval size = 2 area = no }
					garrison = { country = USA province = 2494  type = naval size = 2 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERAirAINaval }
		command = { type = local_clrflag which = GERAirAIStrategic }
		command = { type = local_setflag which = GERAirAIGround }
		command = { type = ai which = "switch/GER_Air_Ground.ai" }
	}
}
################
# German Air AI Strategic portion
#############################################
event = {
	id = 20028
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			NOT = { local_flag = GERAirAIStrategic }
			AND = {
				day = 1
				NOT = { day = 2 }
			}
		}
		# These statements must be false if not the land air AI has priority
		NOT = {
			lost_national = { country = GER value = 2 }
			war = { country = GER country = POL } # Eastern Europe
			war = { country = GER country = CZE }
			war = { country = GER country = HUN }
			war = { country = GER country = ROM }
			war = { country = GER country = YUG }
			war = { country = GER country = GRE }
			war = { country = GER country = LIT }
			war = { country = GER country = LAT }
			war = { country = GER country = EST }
			war = { country = GER country = BUL }
			war = { country = GER country = SOV }
			war = { country = GER country = AUS } # Central Europe
			war = { country = GER country = ITA }
			AND = { 								# LOW COUNTRIES
				war = { country = GER country = HOL }
				NOT = { control = { province = 47 data = GER } } # Amsterdamm
			}
			AND = {
				war = { country = GER country = BEL }
				NOT = { control = { province = 51 data = GER } } # Brussels
			}
			war = { country = GER country = LUX }
			war = { country = GER country = SPR } # Western Europe
			war = { country = GER country = SPA }
			war = { country = GER country = POR }
			war = { country = GER country = VIC }
			AND = {
				war = { country = GER country = FRA }
				NOT = { control = { province = 56 data = GER } } # Paris
				OR = {
					war = { country = GER country = HOL }
					war = { country = GER country = BEL }
				}
			}
		}
		# These statements have to be true for it to load naval AI
		NOT = {
			local_flag = GERInvadeEngland
			AND = {
				war = { country = FRA country = GER }
				OR = {
					# Baltic
					garrison = { country = FRA province = 2473  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2474  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2475  type = naval size = 2 area = no }
					garrison = { country = FRA province = 290   type = naval size = 2 area = no }
					garrison = { country = FRA province = 2476  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2477  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2478  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2479  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2480  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2481  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2482  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2483  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2484  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2489  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2491  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2492  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2493  type = naval size = 2 area = no }
					garrison = { country = FRA province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = ENG country = GER }
				OR = {
					# Baltic
					garrison = { country = ENG province = 2473  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2474  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2475  type = naval size = 2 area = no }
					garrison = { country = ENG province = 290   type = naval size = 2 area = no }
					garrison = { country = ENG province = 2476  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2477  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2478  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2479  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2480  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2481  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2482  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2483  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2484  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2489  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2491  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2492  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2493  type = naval size = 2 area = no }
					garrison = { country = ENG province = 2494  type = naval size = 2 area = no }
				}
			}
			AND = {
				war = { country = USA country = GER }
				OR = {
					# Baltic
					garrison = { country = USA province = 2473  type = naval size = 2 area = no }
					garrison = { country = USA province = 2474  type = naval size = 2 area = no }
					garrison = { country = USA province = 2475  type = naval size = 2 area = no }
					garrison = { country = USA province = 290   type = naval size = 2 area = no }
					garrison = { country = USA province = 2476  type = naval size = 2 area = no }
					garrison = { country = USA province = 2477  type = naval size = 2 area = no }
					garrison = { country = USA province = 2478  type = naval size = 2 area = no }
					garrison = { country = USA province = 2479  type = naval size = 2 area = no }
					garrison = { country = USA province = 2480  type = naval size = 2 area = no }
					garrison = { country = USA province = 2481  type = naval size = 2 area = no }
					garrison = { country = USA province = 2482  type = naval size = 2 area = no }
					garrison = { country = USA province = 2483  type = naval size = 2 area = no }
					garrison = { country = USA province = 2484  type = naval size = 2 area = no }
					garrison = { country = USA province = 2489  type = naval size = 2 area = no }
					garrison = { country = USA province = 2491  type = naval size = 2 area = no }
					garrison = { country = USA province = 2492  type = naval size = 2 area = no }
					garrison = { country = USA province = 2493  type = naval size = 2 area = no }
					garrison = { country = USA province = 2494  type = naval size = 2 area = no }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERAirAINaval }
		command = { type = local_setflag which = GERAirAIStrategic }
		command = { type = local_clrflag which = GERAirAIGround }
		command = { type = ai which = "switch/GER_Air_Strategic.ai" }
	}
}
################
# Germany sends Italy help
#############################################
event = {
	id = 20029
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = GERDefendItaly }
		alliance = { country = ITA country = GER }
		NOT = { lost_national = { country = GER value = 2 } }
		OR = {
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 2 }
				control = { province = 534 data = ITA } # Sardinia
			}
			AND = { # Means they attacked Italy
				lost_national = { country = ITA value = 10 }
				NOT = { control = { province = 534 data = ITA } }# Sardinia
			}
			AND = { # Means they are preparing to attack Italy
				# Libya
				NOT = { control = { province = 932 data = ITA } }
				NOT = { control = { province = 924 data = ITA } }
				NOT = { control = { province = 919 data = ITA } }
			}
			
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERDefendItaly }
		command = { type = ai which = "switch/GER_ITA_Defense.ai" }
	}
}
################
# Germany pulls its help from Italy help
#############################################
event = {
	id = 20030
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = GERDefendItaly
		alliance = { country = ITA country = GER }
		OR = {
			lost_national = { country = GER value = 2 }
			NOT = {
				AND = { # Means they attacked Italy
					lost_national = { country = ITA value = 2 }
					control = { province = 534 data = ITA } # Sardinia
				}
				AND = { # Means they attacked Italy
					lost_national = { country = ITA value = 10 }
					NOT = { control = { province = 534 data = ITA } }# Sardinia
				}
				AND = { # Means they are preparing to attack Italy
					# Libya
					NOT = { control = { province = 932 data = ITA } }
					NOT = { control = { province = 924 data = ITA } }
					NOT = { control = { province = 919 data = ITA } }
				}
				
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERDefendItaly }
		command = { type = ai which = "switch/GER_ITA_Recall_Defense.ai" }
	}
}
################
# Germany cancels Sea Lion and goes after Russia
#############################################
event = {
	id = 20031
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		exists = SOV
		local_flag = GERInvadeEngland
		control = { province = 56 data = GER } # Paris
		NOT = { event = 2024 } # Bitter Peace
		NOT = { lost_national = { country = GER value = 2 } }
		NOT = { war = { country = SPR country = GER } }
		NOT = { war = { country = SPA country = GER } }
		NOT = { war = { country = YUG country = GER } }
		NOT = { war = { country = USA country = GER } }
		NOT = { war = { country = POL country = GER } }
		NOT = { war = { country = HUN country = GER } }
		NOT = { war = { country = ITA country = GER } }
		NOT = { war = { country = ROM country = GER } }
		OR = {
			NOT = { transport = { country = GER value = 4 } } # >= 4 transport
			AND = {
				NOT = { control = { province = 5 data = ENG } }
				NOT = { control = { province = 6 data = ENG } }
				NOT = { control = { province = 3 data = ENG } }
				NOT = { control = { province = 7 data = ENG } }
				NOT = { control = { province = 8 data = ENG } }
				NOT = { control = { province = 9 data = ENG } }
				NOT = { control = { province = 10 data = ENG } }
				NOT = { control = { province = 11 data = ENG } }
				NOT = { control = { province = 12 data = ENG } }
				NOT = { control = { province = 13 data = ENG } }
				NOT = { control = { province = 14 data = ENG } }
				NOT = { control = { province = 15 data = ENG } }
				NOT = { control = { province = 16 data = ENG } }
				NOT = { control = { province = 17 data = ENG } }
				NOT = { control = { province = 19 data = ENG } }
				NOT = { control = { province = 22 data = ENG } }
				NOT = { control = { province = 20 data = ENG } }
				NOT = { control = { province = 21 data = ENG } }
				NOT = { control = { province = 23 data = ENG } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeRussia }
		command = { type = local_clrflag which = GERInvadeSpain }
		command = { type = local_clrflag which = GERInvadeEngland }		
	}
}
################
# Spanish invasion setup and Sea Lion
#############################################
event = {
	id = 20032
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		NOT = { local_flag = GERInvadeEngland }
		local_flag = GERInvadeSpain
		OR = {
			AND = {
				NOT = { exists = SPR }
				exists = SPA
			}
			AND = {
				NOT = { exists = SPR }
				NOT = { exists = SPA }
			}
			AND = {
				war = { country = SPR country = SPA }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeEngland }
		command = { type = local_clrflag which = GERInvadeSpain }
		command = { type = ai which = "switch/GER_Sealion.ai" }
	}
}
event = {
	id = 20033
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		exists = SPR
		NOT = { local_flag = GERInvadeEngland }
		local_flag = GERInvadeSpain
		day = 2
		NOT = { day = 3 }
		exists = VIC
		NOT = { war = { country = SPR country = GER } }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeSpain }
		command = { type = local_setflag which = GERInvadeEngland }
		command = { type = ai which = "switch/GER_SPR_Buildup_VIC.ai" }
	}
}
event = {
	id = 20034
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		exists = SPR
		NOT = { local_flag = GERInvadeEngland }
		local_flag = GERInvadeSpain
		day = 2
		NOT = { day = 3 }
		NOT = { exists = VIC }
		NOT = { war = { country = SPR country = GER } }
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERInvadeSpain }
		command = { type = local_setflag which = GERInvadeEngland }
		command = { type = ai which = "switch/GER_SPR_Buildup.ai" }
	}
}
event = {
	id = 20035
	random = no 
	country = GER
	
	trigger = {
		ai = yes
		exists = SPR
		local_flag = GERInvadeEngland
		local_flag = GERInvadeSpain
		day = 1
		NOT = { day = 2 }
		OR = { # Spanish Invasion buildup events
			event = 20033
			event = 20034
		}
		OR = {
			war = { country = SPR country = GER }
			AND = {
				month = 3 # March
				NOT = {	month = 4 } # April
				random = 10
			}
			AND = {
				month = 3 # April
				NOT = {	month = 4 } # May
				random = 20
			}
			AND = {
				month = 4 # May
				NOT = {	month = 5 } # June
				random = 40
			}
			AND = {
				month = 5 # June
				NOT = {	month = 6 } # July
				random = 80
			}
			AND = {
				month = 6 # July
				NOT = {	month = 9 } # October
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERInvadeEngland }
		command = { type = ai which = "switch/GER_SPR.ai" }
		command = { type = sleepevent which = 20033 }
		command = { type = sleepevent which = 20034 }
		command = { type = war which = SPR }
	}
}


################
# German Military Building AI
#############################################
# Building Style Flags
#	GERBuildStandard		= Standard Build when strategy is unknown
#	GERBuildNavy			= Build Navy when preparing to attack the UK and USA
#	GERBuildLand			= Build heavy on the land troops with no sea
#	GERBuildMix				= Build mix of land and subs
################
# German Standard Building AI
#############################################
event = { 
	id = 20036
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			AND = {
				atwar = no
				year = 1940
			}
			AND = {
				atwar = yes
				NOT = { local_flag = GERInvadeRussia }
				NOT = { war= { country = GER country = SOV } }
				NOT = { local_flag = GERInvadeSpain }
				NOT = { local_flag = GERInvadeEngland }
				NOT = { war= { country = GER country = SPR } }
				NOT = { war= { country = GER country = SPA } }
				NOT = { local_flag = GERInvadeYugoslavia }
				NOT = { war= { country = GER country = YUG } }
				land_percentage = { country = SOV value = 0.8 }
				land_percentage = { country = USA value = 1.2 }
				land_percentage = { country = ENG value = 1.2 }
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERBuildStandard }
		command = { type = local_clrflag which = GERBuildMix }
		command = { type = local_clrflag which = GERBuildLand }
		command = { type = local_clrflag which = GERBuildNavy }
		command = { type = ai which = "switch/GER_Build_Standard.ai" }
	}
}
################
# German Mix Building AI
#############################################
event = { 
	id = 20037
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		land_percentage = { country = SOV value = 0.8 }
		land_percentage = { country = USA value = 1.2 }
		land_percentage = { country = ENG value = 1.2 }
		OR = {
			local_flag = GERInvadeRussia
			local_flag = GERInvadeYugoslavia
			war= { country = GER country = SOV }
			war= { country = GER country = YUG }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERBuildStandard }
		command = { type = local_setflag which = GERBuildMix }
		command = { type = local_clrflag which = GERBuildLand }
		command = { type = local_clrflag which = GERBuildNavy }
		command = { type = ai which = "switch/GER_Build_Mix.ai" }
	}
}
################
# German Land Building AI
#############################################
event = { 
	id = 20038
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		OR = {
			AND = {
				local_flag = GERInvadeSpain
				local_flag = GERInvadeEngland
				OR = {
					land_percentage = { country = SOV value = 0.6 }
					land_percentage = { country = USA value = 1.0 }
					land_percentage = { country = ENG value = 1.0 }
				}
			}
			AND = {
				NOT = { local_flag = GERInvadeSpain }
				NOT = { local_flag = GERInvadeEngland }
				OR = {
					NOT = { land_percentage = { country = SOV value = 0.8 } }
					NOT = { land_percentage = { country = USA value = 1.2 } }
					NOT = { land_percentage = { country = ENG value = 1.2 } }
				}
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERBuildStandard }
		command = { type = local_clrflag which = GERBuildMix }
		command = { type = local_setflag which = GERBuildLand }
		command = { type = local_clrflag which = GERBuildNavy }
		command = { type = ai which = "switch/GER_Build_Land.ai" }
	}
}
################
# German Navy Building AI
#############################################
event = { 
	id = 20039
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		atwar = yes
		land_percentage = { country = SOV value = 0.6 }
		land_percentage = { country = USA value = 1.0 }
		land_percentage = { country = ENG value = 1.0 }
		OR = {
			local_flag = GERInvadeSpain
			local_flag = GERInvadeEngland
		}
	}

	name = "AI_EVENT"
	style = 0
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERBuildStandard }
		command = { type = local_clrflag which = GERBuildMix }
		command = { type = local_clrflag which = GERBuildLand }
		command = { type = local_setflag which = GERBuildNavy }
		command = { type = ai which = "switch/GER_Build_Navy.ai" }
	}
}
################
# Germany builds submarines
#############################################
event = {
	id = 20040
	random = no
	country = GER
	persistent = yes

	trigger = {
		ai = yes
		NOT = { lost_national = { country = GER value = 1 } }
		OR = {
			AND = {
				atwar = no
				NOT = { submarine = { country = GER value = 10 } }
			}
			AND = {
				atwar = yes
				NOT = { submarine = { country = GER value = 20 } }
			}
		}
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = build_division which = submarine }
	}
}
################
# Germany builds Fortifications on the French Border
#############################################
event = {
	id = 20041
	random = no
	country = GER

	trigger = {
		ai = yes
		atwar = no
		technology = 5100
		control = { province = 74 data = GER } # Saarbrucken
		control = { province = 314 data = GER } # Stuttgart
		control = { province = 315 data = GER } # Freiburg
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1939 }

	action_a = {
		command = { type = ai which = "switch/GER_Build_Fort.ai" }
	}
}
################
# Japan builds transports
#############################################
event = {
	id = 20042
	random = no
	country = GER
	persistent = yes

	trigger = {
		ai = yes
		atwar = yes
		NOT = { transport = { country = GER value = 3 } }
		NOT = { lost_national = { country = GER value = 2 } }
	}

	name = "AI_EVENT"
	style = 0

	date = { day = 1 month = january year = 1936 }
	offset = 7
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = build_division which = transport }
	}
}








####################################
# Germany 20500 - 20599 = Minister Change Events
####################################
################
# Minister of Security Section 20500 - 20509
#############################################
event = { # Franz Grtner takes power
	id = 20500
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 223 # Franz Grtner
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERSecurityFranz }
		}
		OR = {
			NOT = { control = { province = 56 data = GER } } # Paris
			AND = {
				control = { province = 56 data = GER } # Paris
				NOT = { minister = 108 } # Heinrich Himmler
			}
		}
		OR = {
			manpower = 200
			AND = {
				NOT = { manpower = 200 }
				NOT = { minister = 226 } # Walter Buch
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERSecurityFranz }
		command = { type = local_clrflag which = GERSecurityHeinrich }
		command = { type = local_clrflag which = GERSecurityWalter }
		command = { type = ministerofsecurity which = 223 }
		command = { type = dissent value = -1 }
	}
}
event = { # Heinrich Himmler takes power
	id = 20501
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 108 # Heinrich Himmler
		manpower = 200
		control = { province = 56 data = GER } # Paris
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERSecurityHeinrich }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERSecurityFranz }
		command = { type = local_setflag which = GERSecurityHeinrich }
		command = { type = local_clrflag which = GERSecurityWalter }
		command = { type = ministerofsecurity which = 108 }
		command = { type = dissent value = -1 }
	}
}
event = { # Walter Buch takes power
	id = 20502
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 226 # Walter Buch
		NOT = { manpower = 200 }
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERSecurityWalter }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERSecurityFranz }
		command = { type = local_clrflag which = GERSecurityHeinrich }
		command = { type = local_setflag which = GERSecurityWalter }
		command = { type = ministerofsecurity which = 226 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Staff Section 20510 - 20519 
#############################################
event = { # Erich Hoepner takes power
	id = 20510
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 160 # Erich Hoepner
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefHoepner }
		}
		OR = {
			AND = {
				atwar = no
				manpower = 200
			}
			AND = {
				NOT = { minister = 7 } # Ludwig Beck
				NOT = { minister = 168 } # Adolf Heusinger
				NOT = { minister = 156 } # Alfred Jodl
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefHeusinger }
		command = { type = local_setflag which = GERChiefHoepner }
		command = { type = local_clrflag which = GERChiefBeck }
		command = { type = local_clrflag which = GERChiefJodl }
		command = { type = chiefofstaff which = 160 }
		command = { type = dissent value = -1 }
	}
}
event = { # Adolf Heusinger takes power
	id = 20511
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 168 # Adolf Heusinger
		NOT = { minister = 160 } # Erich Hoepner		
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefHeusinger }
		}
		OR = {
			NOT = { manpower = 200 }
			AND = {
				NOT = { minister = 7 } # Ludwig Beck
				NOT = { minister = 160 } # Erich Hoepner
				NOT = { minister = 156 } # Alfred Jodl
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERChiefHeusinger }
		command = { type = local_clrflag which = GERChiefHoepner }
		command = { type = local_clrflag which = GERChiefBeck }
		command = { type = local_clrflag which = GERChiefJodl }
		command = { type = chiefofstaff which = 168 }
		command = { type = dissent value = -1 }
	}
}
event = { # Ludwig Beck takes power
	id = 20512
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 7 # Ludwig Beck
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefBeck }
		}
		OR = {
			AND = {
				atwar = yes
				NOT = { war = { country = GER country = SOV } }
				manpower = 200
			}
			AND = {
				NOT = { minister = 168 } # Adolf Heusinger
				NOT = { minister = 156 } # Alfred Jodl
				NOT = { minister = 160 } # Erich Hoepner
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefHeusinger }
		command = { type = local_clrflag which = GERChiefHoepner }
		command = { type = local_setflag which = GERChiefBeck }
		command = { type = local_clrflag which = GERChiefJodl }
		command = { type = chiefofstaff which = 7 }
		command = { type = dissent value = -1 }
	}
}
event = { # Alfred Jodl takes power
	id = 20513
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 156 # Alfred Jodl
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefJodl }
		}
		OR = {
			AND = {
				war = { country = GER country = SOV }
				manpower = 200
			}
			AND = {
				NOT = { minister = 7 } # Ludwig Beck
				NOT = { minister = 168 } # Adolf Heusinger
				NOT = { minister = 160 } # Erich Hoepner
			}
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefHeusinger }
		command = { type = local_clrflag which = GERChiefHoepner }
		command = { type = local_clrflag which = GERChiefBeck }
		command = { type = local_setflag which = GERChiefJodl }
		command = { type = chiefofstaff which = 156 }
		command = { type = dissent value = -1 }
	}
}
################
# Head of Intelligence Section 20520 - 20529 
#############################################
event = { # Hans Oster takes power
	id = 20520
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 146 # Hans Oster
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERIntelligenceHans }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERIntelligenceHans }
		command = { type = ministerofintelligence which = 146 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of the Army Section 20530 - 20539
#############################################
event = { # Fedor von Bock takes power
	id = 20530
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 182 # Fedor von Bock
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERArmyBock }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERArmyBock }
		command = { type = local_clrflag which = GERArmyWalter }
		command = { type = chiefofarmy which = 182 }
		command = { type = dissent value = -1 }
	}
}
event = { # Walter von Lttwitz takes power
	id = 20531
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 185 # Walter von Lttwitz
		NOT = { minister = 182 } # Fedor von Bock
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERArmyWalter }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERArmyBock }
		command = { type = local_setflag which = GERArmyWalter }
		command = { type = chiefofarmy which = 185 }
		command = { type = dissent value = -1 }
	}
}
################
# Armament Minister Section 20540 - 20549
#############################################
event = { # Hjalmar Schacht takes power
	id = 20540
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 77 # Hjalmar Schacht
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERArmamentSchacht }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERArmamentSchacht }
		command = { type = local_clrflag which = GERArmamentSpeer }
		command = { type = local_clrflag which = GERArmamentKrosigk }
		command = { type = armamentminister which = 77 }
		command = { type = dissent value = -1 }
	}
}
event = { # Albert Speer takes power
	id = 20541
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 86 # Albert Speer
		NOT = { minister = 77 } # Hjalmar Schacht
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERArmamentSpeer }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERArmamentSchacht }
		command = { type = local_setflag which = GERArmamentSpeer }
		command = { type = local_clrflag which = GERArmamentKrosigk }
		command = { type = armamentminister which = 86 }
		command = { type = dissent value = -1 }
	}
}

event = { # Johann Schwerin von Krosigk takes power
	id = 20542
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		minister = 85 # Johann Schwerin von Krosigk
		NOT = { minister = 86 } # Albert Speer
		NOT = { minister = 77 } # Hjalmar Schacht
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERArmamentKrosigk }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERArmamentSchacht }
		command = { type = local_clrflag which = GERArmamentSpeer }
		command = { type = local_setflag which = GERArmamentKrosigk }
		command = { type = armamentminister which = 85 }
		command = { type = dissent value = -1 }
	}
}
################
# Chief of Air Minister Section 20550 - 20559
# Air AI Flags
#	GERAirAINaval			= Germany has there Air vs Naval AI loaded
#	GERAirAIStrategic		= Germany has their Strategic bombing AI loaded
#	GERAirAIGround			= Germany has their ground support AI loaded
#############################################
event = { # Hermann Gring takes power
	id = 20550
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = GERAirAIGround
		minister = 10 # Hermann Gring
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefAirHermann }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_setflag which = GERChiefAirHermann }
		command = { type = local_clrflag which = GERChiefAirKarl }
		command = { type = local_clrflag which = GERChiefAirCarl }
		command = { type = local_clrflag which = GERChiefAirUlrich }
		command = { type = chiefofair which = 10 }
		command = { type = dissent value = -1 }
	}
}
event = { # Karl Koller takes power
	id = 20551
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		local_flag = GERAirAIGround
		NOT = { minister = 10 }# Hermann Gring
		minister = 205 # Karl Koller
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefAirKarl }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefAirHermann }
		command = { type = local_setflag which = GERChiefAirKarl }
		command = { type = local_clrflag which = GERChiefAirCarl }
		command = { type = local_clrflag which = GERChiefAirUlrich }
		command = { type = chiefofair which = 205 }
		command = { type = dissent value = -1 }
	}
}
event = { # Carl Friedrich von Siemens takes power
	id = 20552
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			local_flag = GERAirAINaval
			local_flag = GERAirAIStrategic			
		}
		minister = 208 # Carl Friedrich von Siemens
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefAirCarl }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefAirHermann }
		command = { type = local_clrflag which = GERChiefAirKarl }
		command = { type = local_setflag which = GERChiefAirCarl }
		command = { type = local_clrflag which = GERChiefAirUlrich }
		command = { type = chiefofair which = 208 }
		command = { type = dissent value = -1 }
	}
}
event = { # Ulrich Grauert takes power
	id = 20553
	random = no 
	country = GER
	persistent = yes
	
	trigger = {
		ai = yes
		OR = {
			local_flag = GERAirAINaval
			local_flag = GERAirAIStrategic			
		}
		minister = 236 # Ulrich Grauert
		NOT = { minister = 208 } # Carl Friedrich von Siemens
		OR = {
			AND = {
				day = 1
				NOT = { day = 2 }
			}
			NOT = { local_flag = GERChiefAirUlrich }
		}
	}

	name = "AI_EVENT"
	style = 0	
	
	date = { day = 1 month = january year = 1936 }
	offset = 1
	deathdate = { day = 29 month = december year = 1948 }

	action_a = {
		command = { type = local_clrflag which = GERChiefAirHermann }
		command = { type = local_clrflag which = GERChiefAirKarl }
		command = { type = local_clrflag which = GERChiefAirCarl }
		command = { type = local_setflag which = GERChiefAirUlrich }
		command = { type = chiefofair which = 236 }
		command = { type = dissent value = -1 }
	}
}